<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"  %>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'roomlist.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
		<FORM name="myForm" method="post" action="room/selectRoom.action" >
		<div id="content_right">
			<TABLE class=table cellSpacing=1>
				<TR class=table_header>
					<TD vAlign=center align=left>
						机房ID
					</TD>
					<TD vAlign=center align=left>
						机房名称
					</TD>
					<TD vAlign=center align=left>
						所属部门编号
					</TD>
					<TD vAlign=center align=left>
						负责人编号
					</TD>
					<TD vAlign=center align=left>
						地址
					</TD>

				</TR>

				<TD vAlign=center>
					<input type="text" name="ccId" id ="ccId" onkeyup="value=this.value.replace(/\D+/g,'')">
				</TD>
				<TD vAlign=center>
					<input type="text" name="ccName" id ="ccName" value="">
				</TD>
				<TD vAlign=center>
					<select name="department" id ="department">
					        <option value="">
								<s:property value="" />
							</option>
						<s:iterator value="list01" var="li01">

							<option value="${li01.deptId}">
								<s:property value="#li01.deptId" />
							</option>

						</s:iterator>
					</select>
				</TD>
				<TD vAlign=center>
					<select name="employee" id="employee">
					        <option value="">
								<s:property value="" />
							</option>
						<s:iterator value="list02" var="li02">

							<option value="${li02.empId}">
								<s:property value="#li02.empId" />
							</option>

						</s:iterator>
					</select>
				</TD>
				<TD vAlign=center>
					<input type="text" name="ccAddr" id ="ccAddr" value="">
				</TD>

			</TABLE>
			<p align="center">
						<!--<font color="red">${msg5}</font>  -->

			<input type="submit" class="button"  value="查询" >			
		    </p>
		    </div>
			</FORM>
			
            <BR>
			<BR>
			<BR>
			<div id="content_right">
			<TABLE class=table cellSpacing=1>
				<TBODY>
					<TR class=table_header>
						<TD vAlign=center align=left>
							机房ID
						</TD>
						<TD vAlign=center align=left>
							机房名称
						</TD>
						<TD vAlign=center align=left>
							所属部门编号
						</TD>
						<TD vAlign=center align=left>
							负责人编号
						</TD>
						<TD vAlign=center align=left>
							地址
						</TD>

					</TR>
					<s:iterator value="listroom" var="lir" status="s">
						<tr class="row${st.index%2+1}">

							<td valign="middle" align="left">
								<s:property value="#lir.ccId" />
							</td>
							<td valign="middle" align="left">
								<s:property value="#lir.ccName" />
							</td>
							<td valign="middle" align="left">
								<s:property value="#lir.department.deptId" />
							</td>
							<td valign="middle" align="left">
								<s:property value="#lir.employee.empId" />
							</td>
							

							<td valign="middle" align="left">
								<s:property value="#lir.ccAddr" />
							</td>

						</tr>
					</s:iterator>                 
				</TBODY>
			</TABLE>
			
			<BR>
			<BR>
			<BR>			
			<BR>
		<p class="paging">
						<s:if test="%{page == 1}">
							&lt;&lt; 首页 &lt; 上一页
						</s:if>
							<s:else>
								<a href="room/toSelectRoom.action?page=1"> &lt;&lt;首页</a>
								<a href="room/toSelectRoom.action?page=${page-1}">&lt; 上一页 </a>
							</s:else>

							<strong>第${page}页/共${totalPages}页</strong>

						<s:if test="%{page == totalPages}">
							下一页 &gt;
							末页 &gt;&gt;
						</s:if>
							<s:else>
								<a href="room/toSelectRoom.action?page=${page+1}"> 下一页 &gt;</a>
								<a href="room/toSelectRoom.action?page=${totalPages}">末页 &gt;&gt;</a>
							</s:else>
						</p>
		</div>
	</body>
</html>
